{% extends "forum/base.html" %}
{% comment %}
<!--
  Copyright (C) 2008 ZHENG Zhong <heavyzheng nospam-at gmail D0T com>
  - http://heavyz.blogspot.com/
  - http://buggarden.blogspot.com/
  
  The forum home page. This page displays a list of forum boards, and a link to create a new board.
  
  File created on 2008-05-07.
  $Id: view_forum.html 251 2008-10-27 15:06:45Z heavyzheng $
-->
{% endcomment %}

{#------------------------------------------------------------------------------------------------#}

{% block html_head %}
<title>The Bug Garden Forum</title>
{% endblock %}{# html_head #}

{#------------------------------------------------------------------------------------------------#}

{% block header %}
<div class="title">The Bug Garden Forum</div>
{% endblock %}{# header #}

{#------------------------------------------------------------------------------------------------#}

{% block content %}

<div class="section">

  <table class="bordered" cellspacing="0" width="100%">
    
    <tr class="head-row">
      <td class="nowrap" colspan="2">Boards</td>
      <td class="nowrap" width="15%">Last Post</td>
      <td class="nowrap" align="center" width="1%">Threads</td>
      <td class="nowrap" align="center" width="1%">Posts</td>
      <td class="nowrap" align="center" width="1%">Manager(s)</a>
    </tr>
    
    {% for board in boards %}
      <tr class="{% cycle odd-row,even-row %}">
        <td>
          <img src="/static/forum/images/board_icon.png" alt="Board"/>
          <b><a href="/forum/board/{{ board.key.id }}/">{{ board.name|escape }}</a></b>
          <br/>
          <span class="small">{{ board.desc|escape }}</span>
        </td>
        <td class="nowrap" align="right" width="1%">
          {% if board.is_current_user_manager %}
            <a href="/forum/admin_board/{{ board.key.id }}/">
              <img src="/static/forum/images/admin_icon.png" alt="Admin"/>
            </a>
          {% endif %}
        </td>
        <td class="nowrap small" width="15%">
          {% if board.last_post_author and board.last_post_date %}
            by <a href="#TODO">{{ board.last_post_author.nickname }}</a><br/>
            at {{ board.last_post_date|date:"Y-m-d h:i:s A" }}
          {% endif %}
          {% if not board.last_post_author or not board.last_post_date %}
            N/A
          {% endif %}
        </td>
        <td class="nowrap small" align="center" width="1%">
          {{ board.threads }}
        </td>
        <td class="nowrap small" align="center" width="1%">
          {{ board.posts }}
        </td>
        <td class="nowrap small" align="center" width="1%">
          {% for manager in board.managers %}
            <a href="#TODO">{{ manager.nickname }}</a><br/>
          {% endfor %}
        </td>
      </tr>
    {% endfor %}

  </table>

</div><!--/.section-->

<div class="section">
  <table class="bordered" cellspacing="0" width="100%">
    <tr class="head-row">
      <td class="nowrap">Forum Statistics</td>
    </tr>
    <tr class="plain-row">
      <td>
        <img src="/static/forum/images/stats_icon.png" alt="Stats"/>
        <b>{{ thread_count }}</b> threads and <b>{{ post_count }}</b> posts have been posted.
      </td>
    </tr>
  </table>
</div><!--/.section-->

<div class="section">
  <img src="/static/forum/images/post_icon.png" alt="post_icon.png"/>
  <a href="/forum/create_board/">Create a new board</a>
</div><!--/.section-->

{% endblock %}{# content #}



